// import React from 'react'
import {lazy,Suspense} from 'react'
import { HashRouter ,Routes, Route,Navigate,useNavigate} from 'react-router-dom'
const Index =lazy(()=>import('../pages/index'))
const Manage = lazy(()=> import('../pages/manage/manage'))
const Shoplist = lazy(()=> import('../pages/management/shoplist/shoplist'))
const Userlist = lazy(()=> import('../pages/management/userlist/userlist'))
const Foodlist = lazy(()=> import('../pages/management/foodrList/foodList'))
const Orderlist = lazy(()=> import('../pages/management/orderList/orderList'))
const Adminlist = lazy(()=> import('../pages/management/adminList/adminList'))
const Visitor = lazy(()=> import('../pages/management/visitor/vieitor'))
const BasicTouter = ()=> {
     return  <HashRouter>
            <Suspense fallback={''}>
                <Routes>
                    <Route path="/" element={<Index></Index>}>
                        <Route index element={ <Manage />}></Route>
                        <Route path='manage' element={ <Manage />}></Route>
                        <Route path='userlist' element={<Userlist />}></Route>
                        <Route path='shoplist' element={<Shoplist />}></Route>
                        <Route path='foodlist' element={<Foodlist />}></Route>
                        <Route path='adminlist' element={<Adminlist />}></Route>
                        <Route path='orderlist' element={<Orderlist />}></Route>
                        <Route path='visitor' element={<Visitor />}></Route>
                    </Route>
                </Routes>
            </Suspense>    
        </HashRouter>
//    function Index(){
//     let navigate = useNavigate()
//     return(
//         <button onClick={() => navigate("/")}>to: home</button>
//     )
// }     
}

export default BasicTouter